<?php
namespace Admin\Controller;
use Think\Controller;
class ConfigController extends CommonController {
	
	public function _initialize(){
	parent::_initialize();
	$this->model="config";
	$this->key="conf_id";	
	$this->title_index= L('config_index');
	$this->title_details=L('config_details');
	}
	
	public function phpinfo(){
		phpinfo();
	}
	
	public function deleteHandle(){
		$con['conf_name']=array('not in',C('WEB_CONFIG'));
		$con[$this->key]=I('path.2');
		if(M($this->model)->where($con)->delete())
			$this->success(L("delete_success"));
		else
			$this->error(L("config_delete_failed"));	
		//记录日志
	$this->weblog();			
	}
	//在更新配置之后，清空缓存
	public function _after_updateHandle(){
		S('web_config',null);
	}
	//在添加配置后，清空缓存
	public function _after_addHandle(){
		S('web_config',null);
	}
	//在删除配置后，清空缓存
	public function _after_deleteHandle(){
		S('web_config',null);
	}	
	
}